<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title>iptables -F</title>
  <style type="text/css">code{white-space: pre;}</style>
  <style type="text/css">
div.sourceCode { overflow-x: auto; }
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
  margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
code > span.dt { color: #902000; } /* DataType */
code > span.dv { color: #40a070; } /* DecVal */
code > span.bn { color: #40a070; } /* BaseN */
code > span.fl { color: #40a070; } /* Float */
code > span.ch { color: #4070a0; } /* Char */
code > span.st { color: #4070a0; } /* String */
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
code > span.ot { color: #007020; } /* Other */
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
code > span.fu { color: #06287e; } /* Function */
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
code > span.cn { color: #880000; } /* Constant */
code > span.sc { color: #4070a0; } /* SpecialChar */
code > span.vs { color: #4070a0; } /* VerbatimString */
code > span.ss { color: #bb6688; } /* SpecialString */
code > span.im { } /* Import */
code > span.va { color: #19177c; } /* Variable */
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code > span.op { color: #666666; } /* Operator */
code > span.bu { } /* BuiltIn */
code > span.ex { } /* Extension */
code > span.pp { color: #bc7a00; } /* Preprocessor */
code > span.at { color: #7d9029; } /* Attribute */
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
  </style>
  <link rel="stylesheet" href="doc/linux-style.css" type="text/css" />
</head>
<body>
<div id="header">
<h1 class="title">iptables -F</h1>
</div>
<div id="TOC">
<ul>
<li><a href="#nfs环境搭建">nfs环境搭建</a></li>
</ul>
</div>
<h2 id="nfs环境搭建">nfs环境搭建</h2>
<h3 id="server-环境">Server 环境</h3>
<p>nfs server软件安装</p>
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">apt-get</span> install nfs-kernel-server -y <span class="co"># debian</span>
<span class="ex">dnf</span> install nfs-utils -y <span class="co"># openeuler</span></code></pre></div>
<p>然后需要修改配置文件/etc/exports</p>
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">/tmp/</span> *(rw,no_root_squash,fsid=0)           #共享<span class="ex">tmp</span>目录 *代表允许所有IP地质访问共享目录，rw 允许读写，no_root_squash 允许客户端root用户直接以服务端root权限操作文件，NFSv4 要求一个根文件系统（fsid=0），其他导出应作为其子目录。
<span class="ex">/tmp/s_test/</span> *(rw,no_root_squash,fsid=1)
<span class="ex">/tmp/s_scratch</span> *(rw,no_root_squash,fsid=2)</code></pre></div>
<p>使用命令<code>sudo systemctl status nfs-server</code>查看开启状态，如果Acitve：filed则是未开启，需要查看错误信息，然后使用nfs-server_start.sh开启。</p>
<p>同时还需要开启nfs-server</p>
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash">
<span class="fu">mkdir</span> /tmp/s_test
<span class="fu">mkdir</span> /tmp/s_scratch


<span class="bu">ulimit</span> -n 65535
<span class="co"># iptables -F</span>
<span class="ex">exportfs</span> -r
<span class="ex">systemctl</span> stop firewalld
<span class="ex">setenforce</span> 0
<span class="ex">systemctl</span> restart nfs-server.service

<span class="fu">chmod</span> 777 /tmp/s_test
<span class="fu">chmod</span> 777 /tmp/s_scratch    </code></pre></div>
<h3 id="client-环境">Client 环境</h3>
<p>nfs client软件安装</p>
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">apt-get</span> install nfs-common -y <span class="co"># debian</span>
<span class="ex">dnf</span> install nfs-utils -y <span class="co"># openeuler</span></code></pre></div>
<p>nfs clinet 挂载命令：</p>
<pre><code>mount -t nfs -o vers=4.0 ${server_ip}:/s_test /mnt
mount -t nfs -o vers=4.1 ${server_ip}:/s_test /mnt
mount -t nfs -o vers=4.2 ${server_ip}:/s_test /mnt   #这里的server_ip填写实际的NFS服务器地址</code></pre>
<p>一般都会指定vers的版本，如果server端没有配置fisd，那么挂载的根路径将是/，需要用如下命令： <code>mount -t nfs -o vers=4.0 ${server_ip}:/tmp/s_test /mnt # 或 tmp/s_test</code></p>
</body>
</html>
